package com.gxar.file.server.base.common.properties;

import lombok.Data;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @author linsy
 * @version 1.0
 * @created 2023/8/14 11:59
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "spring.redis")
@RefreshScope
public class RedisProperties {

    private String host;
    private Integer port;
    private String username;
    private String password;
    private Integer timeout;
    private final JedisProperties jedisProperties;

    @Data
    @Configuration
    @ConfigurationProperties(prefix = "spring.redis.jedis.pool")
    @RefreshScope
    public static class JedisProperties{

        private Integer maxActive;

        private Integer maxIdle;

        private Integer minIdle;
    }
}

